//--------------------------------------------------------------------------------
// This file is a portion of the PracticeEngine Rendering Engine.  It is distributed
// under the MIT License, available in the root of this distribution and 
// at the following URL:
//
// http://www.opensource.org/licenses/mit-license.php
//
// Copyright (c) Ferdinand Li 
//--------------------------------------------------------------------------------
#ifndef ResourceManager_h__
#define ResourceManager_h__

#include <map>
#include <functional>
#include <d3d11.h>
#include "DX11Renderer.h"

using namespace std;

namespace PracEng
{
	class D3DTexResource
	{
	public:
		D3DTexResource() :pSRV(NULL){}
		~D3DTexResource();
		ID3D11ShaderResourceView* pSRV;
	};

	class ResourceManager
	{
	public:
		~ResourceManager();

		void GetTexture(const wchar_t* Src, DX11Renderer* Dx11Render, ID3D11ShaderResourceView** textureView, UINT forceFmt = 0);

	private:
		map<size_t, D3DTexResource*> m_mapShaderResource;
	};

	static ResourceManager GResourceMgr;
}
#endif // ResourceManager_h__